Conversation
- Implemented Page model with pagination attributes including pageSize, totalElements, totalPages, and pageNumber. - Added SipConnectionMetadata model to encapsulate SIP connection details such as ipAddress, port, credentials, and uuiHeader. - Created SipCredentials model for managing SIP authentication with username and password fields. - Each model includes methods for JSON serialization/deserialization and validation. - Introduced support for additional undeclared properties in each model.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
- Updated CreateEndpointResponse to use CreateEndpointResponseData, Error, and Link classes. - Refactored EndpointResponse, ErrorResponse, and ListEndpointsResponse to replace Error1 and Link1 with Error and Link. - Added CreateEndpointResponseData class with properties and validation methods. - Improved documentation for InboundCallback, LookupResult, MachineDetectionConfiguration, MessageRequest, RbmOpenUrlEnum, RbmWebViewEnum, and StatusCallback. - Created new markdown documentation for CreateEndpointResponseData.
…into brtc-java-sdk
…plify unauthorized exception handling
There was a problem hiding this comment.
Unit tests for the models look great, but like python and C#, there are models that were added to the SDK that don't have unit test files, we need to generate those and fill them in. There also is not a mock/unit test for this API, we need to add that
|
|
||
| @Test | ||
| @Order(1) | ||
| public void shouldCreateNewEndpoint() throws ApiException { |
There was a problem hiding this comment.
| public void shouldCreateNewEndpoint() throws ApiException { | |
| public void createEndpointTest() throws ApiException { |
can we make this and the other methods match most of the other smoke tests where the format is <operationId>Test
| CreateWebRtcConnectionRequest endpointBody = new CreateWebRtcConnectionRequest(); | ||
| endpointBody.setType(EndpointTypeEnum.WEBRTC); | ||
| endpointBody.setDirection(EndpointDirectionEnum.BIDIRECTIONAL); |
There was a problem hiding this comment.
we've moved towards setting the fields on initialization like in the multi-channel smoke tests
| assertThat(response.getStatusCode(), is(201)); | ||
| assertThat(response.getData(), notNullValue()); | ||
| assertThat(response.getData().getData(), notNullValue()); | ||
| assertThat(response.getData().getData(), hasProperty("endpointId", is(instanceOf(String.class)))); | ||
| assertThat(response.getData().getData(), hasProperty("token", is(instanceOf(String.class)))); | ||
| assertThat(response.getData().getData(), hasProperty("type", is(EndpointTypeEnum.WEBRTC))); | ||
| assertThat(response.getData().getData(), hasProperty("status", notNullValue())); | ||
| assertThat(response.getData().getData(), hasProperty("creationTimestamp", notNullValue())); | ||
| assertThat(response.getData().getData(), hasProperty("expirationTimestamp", notNullValue())); | ||
| assertThat(response.getData().getErrors(), instanceOf(List.class)); | ||
| assertThat(response.getData().getErrors(), hasSize(0)); |
There was a problem hiding this comment.
lets make the assertions look more like the ones in the tn lookup and multi-channel smoke tests, not using notNullValue or hasProperty
| assertThat(response.getStatusCode(), is(200)); | ||
| assertThat(response.getData(), notNullValue()); | ||
| assertThat(response.getData().getData(), instanceOf(List.class)); | ||
| assertThat(response.getData().getPage(), notNullValue()); | ||
| assertThat(response.getData().getPage().getTotalElements(), notNullValue()); | ||
| assertThat(response.getData().getErrors(), instanceOf(List.class)); |
There was a problem hiding this comment.
same as above for these and the rest of the assertions
| Endpoints createdEndpoint = response.getData().getData().stream() | ||
| .filter(item -> item.getEndpointId().equals(endpointId)) | ||
| .findFirst() | ||
| .orElse(null); |
There was a problem hiding this comment.
we dont need to do this complex logic, we can just assert the fields exist on the first element in the array
| @Test | ||
| @Order(3) | ||
| public void shouldListEndpointsFilteredByType() throws ApiException { | ||
| ApiResponse<ListEndpointsResponse> response = api.listEndpointsWithHttpInfo(BW_ACCOUNT_ID, EndpointTypeEnum.WEBRTC, null, null, null); | ||
|
|
||
| assertThat(response.getStatusCode(), is(200)); | ||
| assertThat(response.getData().getData(), instanceOf(List.class)); | ||
| assertThat(response.getData().getErrors(), instanceOf(List.class)); | ||
|
|
||
| if (response.getData().getData().size() > 0) { | ||
| boolean allWebRtc = response.getData().getData().stream() | ||
| .allMatch(item -> item.getType() == EndpointTypeEnum.WEBRTC); | ||
| assertThat(allWebRtc, is(true)); | ||
| } | ||
| } |
|
|
||
| @Test | ||
| @Order(4) | ||
| public void shouldRetrieveDetailsOfSpecificEndpoint() throws ApiException { |
There was a problem hiding this comment.
| public void shouldRetrieveDetailsOfSpecificEndpoint() throws ApiException { | |
| public void getEndpointTest() throws ApiException { |
No description provided.